/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;


import java.util.List;

/**
 *
 * @author fumio
 */
public class DaoFabricante extends DaoGenerico{

    @Override
    public List consultar(String parametro, String tipo) {
        String sql = "select f from Fabricante f";
        if ((!parametro.equals(""))) {
            if (tipo.equals("Fabricante")) {
                sql = sql + " where f.fabricante like '%" + parametro + "%'";
            } else {
                sql = sql + " where f.idFabricante = " + parametro;
            }


        }
        sql = sql + " order by f.idFabricante";
        

        return  Dao.select(sql);
    }



  
}
